﻿@page "/General/Legends"
@using LiveChartsCore.SkiaSharpView.Blazor
@using LiveChartsCore;
@using LiveChartsCore.Measure;
@using LiveChartsCore.SkiaSharpView;

<h2>@_legendPosition</h2>

<select @bind="_legendPosition">
    <option value="Hidden">hidden</option>
    <option value="Top">top</option>
    <option value="Left">left</option>
    <option value="Right">right</option>
    <option value="Bottom">bottom</option>
</select>

<CartesianChart
    Series="@series"
    LegendPosition="@_legendPosition">
</CartesianChart>

@code {
    private LegendPosition _legendPosition = LegendPosition.Right;
    private ISeries[] series = new ISeries[]
    {
        new LineSeries<double> { Name = "Series 1", Values = new double[] { 2, 4, 6, 8, 10 } },
        new LineSeries<double> { Name = "Series 2", Values = new double[] { 1, 3, 5, 7, 9 } }
    };
}
